{extend name="public/base" /}

{block name="content"}
<style>
    .img-responsive [data-ratio="16:9"]{
        height: 7rem;
    }
</style>
<!--页面路径 和 页面标题-->
<div class="page-title">

    <div class="title-env">
        <h1 class="title">历史管理</h1>
        <p class="description">查看当前用户的历史记录</p>
    </div>

    <div class="breadcrumb-env">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="/admin"><i class="fa-home"></i>Home</a>
            </li>
            <li class="active">
                <strong>历史记录</strong>
            </li>
        </ol>

    </div>

</div>

<div class="row">
    <div class="col-md-12">

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">记录列表</font></font></h3>
            </div>

            <div class="panel-body panel-border">

                <div class="row gallery-env">

                    <div class="col-sm-12">
                        <div class="album-images row">
                            {foreach $lists as $key => $list}
                            {if condition="($key+1)%4 == 1"}
                            <div class="col-sm-12">
                            {/if}
                            <!-- Album Image -->
                            <div class="col-md-3">
                                <div class="album-image">
                                    <a class="thumb" data-action="edit">
                                        {if condition="!empty($list.url)"}
                                        <img src="{$list.url}" class="img-responsive">
                                        {/if}
                                        {if condition="empty($list.url)"}
                                        <img src="/static/assets/images/album-img-1.png" class="img-responsive">
                                        {/if}
                                    </a>

                                    <a class="name">
                                        <span>{$list.title}</span>
                                        <em>{$list.created_at}</em>
                                    </a>

                                    <div class="image-options">
                                        <a onclick="deleted({$list.id},'history')" data-action="trash"><i class="fa-trash"></i></a>
                                    </div>
                                </div>
                            </div>
                            {if condition="($key+1)%4 == 0"}
                            </div>
                            {/if}
                            {/foreach}

                        </div>
                    </div>
                </div>
                <div class="row">
                    <label class="col-md-6 control-label">共 {$total} 条记录</label>
                    <div class="col-md-6 text-right">
                        <nav aria-label="Page navigation">
                            {$page}
                        </nav>
                    </div>
                </div>
            </div>

        </div>

    </div>
</div>
{/block}

{block name="js"}


<script>
    //删除用户
    function deleted(id,type) {
        if(confirm("是否确认删除")){
            $.ajax({
                url:'/admin/user/deleted',
                method: 'POST',
                dataType: 'json',
                data:{
                    id:id,
                    type:type
                },
                success: function(res)
                {
                    if(res.code == 0) {
                        success(res.message);
                        setTimeout("location.reload()",1000);
                    }else{
                        error(res.mssage);
                    }
                }
            })
        }
    };
</script>
{/block}